<?php
	
	include('includes/smarty.php');
	include_once('config.php');

	session_start();


	$conn = mysql_connect(DB_HOSTNAME, DB_USERNAME, DB_PASSWORD) or die('An error has occured: Could not connect to the MySQL database.');
	mysql_select_db(DB_NAME) or die("An error has occured:  Could not connect to the table.");
	
	$sql = "insert into wms_admin (username, passwd) values('%s', '%s');";	
	$sql = sprintf($sql
		,mysql_real_escape_string('admin')
		,mysql_real_escape_string(hash(algor, 'default')));
		
	$result = mysql_query($sql);

	if(!$result) die("An error has occured: " . mysql_error());
	
	mysql_close($conn);

	
?>